using System;

namespace ebcpatterns
{
    public class SharedState<T>
    {
        internal T data;

        public T Read() {
            return data;
        }

        public void Write(T newData) {
            data = newData;
            DataWritten();
        }

        public event Action DataWritten = delegate { };
    }
}